Parallel and Concurrent Programming in Haskell

نویسنده

  • Simon Marlow
چکیده

ions like timeout are certainly difficult to get right, but fortunately they only have to be written once. We find that in practice dealing with asynchronous exceptions is fairly straightforward, following a few simple rules: • Use bracket when acquiring resources that need to be released again. • Rather than takeMVar and putMVar, use modifyMVar_ (and friends) which have built-in asynchronous exception safety. • If state handling starts getting complicated with multiple layers of exception handlers, then there are two approaches to simplifying things: – Switching to polling mode with mask can help manage complexity. The GHC I/O library, for example, runs entirely inside mask. Note that inside mask it is important to remember that asynchronous exceptions can still arise out of interruptible operations; the documentation contains a list of operations that are guaranteed not to be interruptible. Note: a different semantics was originally described in Marlow et al. [3].

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Intel Concurrent Collections for Haskell

Intel Concurrent Collections (CnC) is a parallel programming model in which a network of steps (functions) communicate through message-passing as well as a limited form of shared memory. This paper describes a new implementation of CnC for Haskell. Compared to existing parallel programming models for Haskell, CnC occupies a useful point in the design space: pure and deterministic like Strategie...

متن کامل

Parallelizing DPLL in Haskell

We report on a case study of implementing parallel variants of the DavisPutnam-Logemann-Loveland algorithm for solving the SAT problem of propositional formulas in the functional programming language Haskell. We explore several state of the art programming techniques for parallel and concurrent programming in Haskell and provide the corresponding implementations. Based on our experimental resul...

متن کامل

Message–passing Implementation for Process Functional Language1

In this paper we introduce the concept an implementation of distributed programming in PFL – a process functional programming language and describe implementation of concurrency in other Haskell–like parallel functional languages – Concurrent Haskell and GpH. The process of writing parallel program is complicated by the need to specify both the parallel behaviour of the program and the algorith...

متن کامل

Implementing a High-Level Distributed-Memory Parallel Haskell in Haskell

We present the initial design, implementation and preliminary evaluation of a new distributed memory parallel Haskell, HdpH. The language is a shallowly embedded parallel extension of Haskell that supports high-level semiexplicit parallelism, is scalable, and has the potential for fault tolerance. The HdpH implementation is designed for maintainability without compromising performance too sever...

متن کامل

High-level Parallel and Concurrent Programming in Eden

Parallel and concurrent programming is commonly handled at a low level of abstraction. Even concurrent declarative languages which are especially appropriate for symbolic computation provide only primitive constructs for that purpose. In contrast, the functional concurrent language Eden is an extension of the lazy functional language Haskell by high level constructs for the explicit specificati...

متن کامل

A Tutorial on Parallel and Concurrent Programming in Haskell

This practical tutorial introduces the features available in Haskell for writing parallel and concurrent programs. We first describe how to write semi-explicit parallel programs by using annotations to express opportunities for parallelism and to help control the granularity of parallelism for effective execution on modern operating systems and processors. We then describe the mechanisms provid...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2011